package com.guigu.ssm.controller;

import com.github.pagehelper.PageInfo;
import com.guigu.ssm.pojo.PageVo;
import com.guigu.ssm.pojo.Shoop;
import com.guigu.ssm.service.ShoopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Controller
public class ShoopController {

    @Autowired(required = false)
    ShoopService dao;

    @RequestMapping("/find")
    @ResponseBody
    public PageVo<Shoop> findAll(@RequestBody Map<String,String> map){
        Integer page =Integer.valueOf(map.get("page"));
        Integer num = Integer.valueOf(map.get("pageNum"));
        String sname = map.get("sname");
        Integer tid = Integer.valueOf(map.get("tid"));

        PageVo<Shoop> all = dao.findAll(page,num,sname,tid);
        return all;
    }
}
